<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script>
  function acctCumul(){
        var startTime =  $("#startTime").val();
        var endTime =  $("#endTime").val();
        $("#settleInfo").load('${ctx}/finance/inpAcctMaster/form?beginTime='+startTime+'&endTime='+endTime);
        $("#acctInfo").load('${ctx}/finance/inpAcctMaster/acctDetail?beginTime='+startTime+'&endTime='+endTime);

  }
   //结账确认
    function acctConfirm(){
        var startTime =  $("#startTime").val();
        var endTime =  $("#endTime").val();
        $.ajax({
             type:'post',
             url:'${ctx}/finance/inpAcctMaster/save?beginTime='+startTime+'&endTime='+endTime,
             success:function (data){
                 if(data.code=='success'){
                      toastr.success("结账成功");
                      loadDiv('mainCenterDiv','${ctx}/finance/inpAcctMaster/index');
                     return ;
                 }else{
                     toastr.error("结账失败");
                     return ;
                 }
             }
        });
    }
</script>
<div class="app bg-default">
    <section class="layout">
        <div class="content-wrap">
            <div class="row" id="topDivId">
                <div class="col-lg-12">
                    <section class="panel">
                        <div class="panel-body">
                            <form class="form-inline" id="patientInfo" >
                                <label>日期 ：</label><input name="beginDate" value="${startTime}"  id="startTime"  class="form-control Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>&nbsp;至<input name="endDate" value="${endTime}" id="endTime"  class="form-control Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
                                &nbsp;&nbsp;<input  class="btn btn-success" type="button" value="结账累计" onclick="acctCumul();"/>
                                &nbsp;&nbsp;<input  class="btn btn-primary" type="button" value="结账确认" onclick="acctConfirm();"/>
                            </form>
                        </div>
                    </section>
                </div>
            </div>
            <div class="row" id="settleInfo">
                  <jsp:include page="inpAcctInfo.jsp"></jsp:include>
            </div>
            <div class="row" id="acctInfo">
                  <jsp:include page="inpAcctdetail.jsp"></jsp:include>
            </div>
        </div>
    </section>
</div>
</div>
</div>